package com.base.social.signature;

import com.base.core.lang.StringUtils;

public class SignatureFactory {

    public static SignatureTemplate instance(String rule){
        SignatureTemplate st = null;
        try{
            rule = StringUtils.capCamelCase(rule, "-".charAt(0));
            String className = "com.tcm.base.social.signature.support." + rule + "Signature";
            Class<?> clazz = SignatureFactory.class.getClassLoader().loadClass(className);
            return (SignatureTemplate) clazz.getConstructor().newInstance();
        }catch (Exception e) {
            e.printStackTrace();
        }
        return st;
    }
}
